# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=libidn2
pkgver=2.3.0
pkgrel=0
pkgdesc="Encode/Decode library for internationalized domain names"
url="https://www.gnu.org/software/libidn#libidn2"
arch="all"
license="GPL-2.0-or-later GPL-3.0-or-later LGPL-3.0-or-later"
makedepends="libunistring-dev"
checkdepends="diffutils"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://ftp.gnu.org/gnu/libidn/libidn2-$pkgver.tar.gz"

# secfixes:
#   2.2.0-r0:
#     - CVE-2019-12290
#   2.1.1-r0:
#     - CVE-2019-18224

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-nls
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	# only keep man pages
	rm -rf "$pkgdir"/usr/share/info
}

sha512sums="a2bf6d2249948bce14fbbc802f8af1c9b427fc9bf64203a2f3d7239d8e6061d0a8e7970a23e8e5889110a654a321e0504c7a6d049bb501e7f6a23d42b50b6187  libidn2-2.3.0.tar.gz"
